using System;
using System.Collections.Generic;
using System.Text;

namespace Coriander.Google.Charting
{
    public struct ChartFillType
    {
        public static readonly ChartFillType Background = new ChartFillType("bg");
        public static readonly ChartFillType ChartArea  = new ChartFillType("c");

        readonly String value;

        /// <summary>
        /// Gets the value
        /// </summary>
        public String Value
        {
            get { return this.value; }
        }        

        /// <summary>
        /// ctor : String
        /// </summary>
        /// <param name="value"></param>
        public ChartFillType(String value)
        { 
            this.value = value;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return Value.GetHashCode(); 
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (null == obj)
                return false;


            if (obj is ChartFillType)
            {
                ChartFillType temp = (ChartFillType)obj;

                if (temp != null)
                {
                    return temp.Value == this.Value;
                }
            }

            return false;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="chartFillType"></param>
        /// <returns></returns>
        public static Boolean operator == (
            ChartFillType chartFillTypeA, 
            ChartFillType chartFillTypeB
        )
        {
            return chartFillTypeA.Equals(chartFillTypeB);  
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="chartFillType"></param>
        /// <returns></returns>
        public static Boolean operator !=(
            ChartFillType chartFillTypeA,
            ChartFillType chartFillTypeB
        )
        {
            return false == chartFillTypeA.Equals(chartFillTypeB);   
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return Value != null ? Value : String.Empty;
        }
    }
}